package com.lesama.operator;

public class OperatorDemo2 {
    public static void main(String[] args) {
        // 逻辑与&   逻辑或|   取反!    异或^
        System.out.println(true & true);
        System.out.println(true & false);
        System.out.println(false & true);
        System.out.println(false & false);
        System.out.println(true | true);
        System.out.println(true | false);
        System.out.println(false | true);
        System.out.println(false | false);
        System.out.println(true ^ true);
        System.out.println(true ^ false);
        System.out.println(false ^ true);
        System.out.println(false ^ false);
        System.out.println(!true);
        System.out.println(!false);

        // 短路与 &&      短路或||
        int x = 4;
        int y = 3;
        boolean flag = x++ > 5 && y-- < 2;
        System.out.println(x);
        System.out.println(y);
        System.out.println(flag);
    }
}
